#!/usr/bin/perl

use warnings;
use strict;

open (SAMPLE, "sample.file") or die $!;

my $min_salary = 40000;

foreach (<SAMPLE>) {
    if ( /(.*):.*:.*:.*:(.*)/ ) {
        if ( $2 > $min_salary ) {
            print $1, "\n";
        }
    }
}

close SAMPLE;
